POV-Ray : Newsgroups : povray.binaries.images : First example of my HF macros : Re: First example of my HF macros Server Time
16 Aug 2024 08:20:19 EDT (-0400)
  Re: First example of my HF macros  
From: Shay
Date: 7 Mar 2002 12:04:31
Message: <3c879d9f$1@news.povray.org>
Hugo <hua### [at] post3teledk> wrote in message news:3c87948e@news.povray.org...

> // My macro to calculate normal of a triangle plane
> #macro CalcNorm(Face_Cnt)
>  #local V1=Vertices[Faces[Face_Cnt].x];
>  #local V2=Vertices[Faces[Face_Cnt].y];
>  #local V3=Vertices[Faces[Face_Cnt].z];
>  vcross(V2-V1,V3-V1);
> #end
>
> Will your extended code be able to fit in
> here somewhere?  :o)

Check this out. My final code is already implemented. This is what I have
been testing. Tor said in another thread that normalizing sums of the
non-normalized vcross of each triangle would give the correct weighted
normal, and he was correct. The only necessary change was from
VPerp_To_Plane to vcross. This actually removes a step, not adds one. I have
tested this several times and have gotten identical results to finding the
normal and area in two seperate steps!

I am pretty sure that vcross(V2-V1,V1-V3) gives a more accurate result than
vcross(V2-V1,V3-V1). Just going on what I have heard on that one. Haven't
tested it myself.

 -Shay


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.